<%@page import="java.util.ArrayList"%>
<%@page import="com.teach.entity.user"%>
<%@page import="java.util.function.Supplier"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.List"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>添加用户</title>
		 <base href="<%=request.getContextPath()%>/"/>
		 <link rel="stylesheet" type="text/css" href="assets/css/admin.css" />
    <script src="assets/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="assets/js/popper.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="assets/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="assets/js/sys.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		 <section>
      <%user u=(user)request.getAttribute("user");
      pageContext.setAttribute("u", u);%>
		
		      <div class="card container-md">
        <div class="card-body">
          <form name="regForm" action="user-update.let" method="POST">
          
           <input type="hidden" name="userId" value="${u.id}"/>
            <input type="hidden" name="userPassword" value="${u.password}"/>
           
           
            <div class="form-group row">
              <div class="col-sm-9">
               <input type="hidden" readonly="date" name="creat_time"  class="form-control-plaintext" style="width:auto;" value="${u.create_time}"/>
              </div>
            </div>
            
            <div class="form-group row">
              <label class="col-sm-3 col-form-label text-right"><b class="text-danger">*</b>用户名</label>
              <div class="col-sm-9">
                <input required="required" readonly="readonly" pattern="^[a-zA-Z]\w{2,19}$" name="userName" type="text" placeholder="由3到20个单词字符组成"
                  title="由3到20个单词字符组成" class="form-control-plaintext" value="${u.name} ">
              </div>
            </div>

             <div class="form-group row">
              <label class="col-sm-3 col-form-label text-right"><b class="text-danger">*</b>昵称</label>
              <div class="col-sm-9">
              <input required="required" name="userNickname" type="text" pattern="^[\u4100-\u9fa5]{2,8}$" placeholder="由2到8个汉字组成"
                  title="由2到8个汉字组成" class="form-control-plaintext" value="${u.nickname}">
                 
              </div>
              
            </div>
            
            <div class="form-group row">
              <label class="col-sm-3 col-form-label text-right"><b class="text-danger">*</b>账号</label>
              <div class="col-sm-9">
              <input required="required" readonly="readonly" name="account_number" type="text" class="form-control-plaintext" value="${u.account_number} ">
                 
              </div>
              
            </div>

           
             <div class="form-group row">
              <label class="col-sm-3 col-form-label text-right"><b class="text-danger">*</b>性别</label>
              <div class="col-sm-9 pt-2">
               <label class="mr-2"><input type="radio" name="userSex" value="true"${u.sex=="男"?" checked=\"checked\"":""}>男</label> 
               <label class="mr-2"> <input type="radio" name="userSex" value="false"${u.sex!="男"?" checked=\"checked\"":""}>女</label>
              </div>
            </div>
            
             <div class="form-group row">
              <label class="col-sm-3 col-form-label text-right"><b class="text-danger">*</b>地址</label>
              <div class="col-sm-9">
              <input required="required" name="user_address" type="text" class="form-control-plaintext" value="${u.user_address} ">
                 
              </div>
              
            </div>
           
            
            
            <div class="form-group row">
              <label class="col-sm-3 col-form-label text-right">出生日期</label>
              <div class="col-sm-9">
               <input readonly="date" name="userBrithdate"  class="form-control-plaintext" style="width:auto;" value="${u.birthday} "/>
              </div>
            </div>
            
           <div class="form-group row">
              <label class="col-sm-3 col-form-label text-right">电话</label>
              <div class="col-sm-9">
                <input readonly="readonly" name="userPhone" type="tel" class="form-control-plaintext" value="${u.phone} ">
              </div>
            </div>
            
           

            <div class="form-group row">
              <div class="col-sm-9 offset-sm-3">
                <button class="btn btn-primary" type="button" onclick="history.go(-1);">返回 </button>
                <button class="btn btn-danger" type="submit"><i class="fa fa-edit mr-2"></i>修改 </button>
              </div>
            </div>

            
         </form>
        </div>
      </div>
    </section>

	</body>

</html>